package com.rd.student.jike.class2.lihongming.week731_806.Day0731;

import java.util.LinkedList;

/**
 * @Auther:Heinrich
 * @Date:2023/7/31-07-31-15:40
 * @Description:c230731.test
 * @version:1.0
 */
public class test06 {


    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        LinkedList<Integer> result = new LinkedList<>();
        for (int i = 0; i < 50; i++) {
            list.add(i);
        }
        while (result.size()<20){
            int i = (int) (Math.random()*list.size());
            result.add(list.get(i));
            list.remove(i);
        }
        System.out.println(result);
    }
}
